/*
 * @Description:
 * @version:
 * @Author: 潘骏杰
 * @Date: 2021-11-10 10:14:13
 * @LastEditors: 潘骏杰
 * @LastEditTime: 2021-11-12 10:13:19
 */
/**
 * @Description:
 * @Author BPF
 * @create 2021/11/5 11:09
 */
import 'core-js/stable'
import 'regenerator-runtime/runtime'
import mandalaUI from '~root/src/index.js'
import '~packages/theme-chalk/src/index.scss'
import '~root/docs/.vuepress/styles/demo-styles/index.scss'
import store from './store/index.js'
import { isBrowser } from './store/helper'
import nprogress from 'nprogress'

// import elementUI from 'element-ui'
// import 'element-ui/packages/theme-chalk/src/index.scss'

export default ({ Vue, options, router, siteData }) => {
  if (isBrowser) {
    Vue.use(mandalaUI)
    // @init
    const { state, reducers } = store
    nprogress.start()
    setTimeout(() => {
      if (state.theme && state.theme !== 'default') {
        mandalaUI.Message.info({
          message: '正在恢复您上次编辑的组件主题',
          type: 'success'
        })
        reducers.changeTheme(state.theme || 'default')
      }
      nprogress.done()
    }, 200)
  }
  // Vue.use(elementUI)
}
